import axios from "axios";

export default function (age, revolvingRatio, thirty, sixty, ninety) {
    return axios({
        method: "post",
        url: "/api/score",
        Headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        },
        data: {
            '90D': ninety,
            'RevolvingRatio': revolvingRatio,
            '30-59D': thirty,
            '60-89D': sixty,
            'Age': age,
        }
    }).then(res => {
        console.log(res)
        console.log(res.data.data.result)
        return {
            result: true,
            score: res.data.data.result
        }
    }).catch(error => {
        console.log(error)
        return {
            result: false
        }
    })

}